package club.zhangliyuanblog.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author liyuan.zhang
 * @date 2021/4/20 11:21
 */
@RestController
public class OrderController {

    @Resource
    private RestTemplate restTemplate;

    private static final String URL = "http://consul-provider-payment";

    @GetMapping("/consul/order")
    public String order() {
        return restTemplate.getForObject(URL + "/payment", String.class);
    }
}
